import { http, http2, http3, http4 } from "../axios.js";

// 登录
export function login(data) {
  return http3.post({
    url: "/auth/oauth/token",
    data,
  });
}

// 退出
export function getLogout(data) {
  return http3.post({
    url: "/auth/logout",
    data,
  });
}

// 获取系统参数接口
export function system(data) {
  return http4.get({
    url: `/user/param/${data}`,
    data,
  });
}

// 根据手机号判断用户是否存在
export function getUserPhone(data) {
  return http4.get({
    url: `/user/exist/${data}`,
    data,
  });
}

// 当用户存在时调用下面接口
// 获取验证码
export function getCode(data) {
  return http4.post({
    url: `/checkcode/?checkCodeType=${data.checkCodeType}&param1=${data.param1}`,
  });
}

// 授权刷新接口
export function getRefresh(data) {
  return http3.post({
    url: "/auth/oauth/token",
    data,
  });
}

// 获取用户绑定微信二维码接口
export function getWeChat(data) {
  return http3.get({
    url: `/user/bindWxQr`,
    data,
  });
}

// 解绑微信账号
export function getUnbind(data) {
  return http4.post({
    url: "/user/unbind/wx",
    data,
  });
}

// 修改密码
export function getEditPwd(data) {
  return http4.post({
    url: "/user/pwd/edit",
    data,
  });
}

// 获取用户信息
export function getUserInfo(data) {
  return http4.get({
    url: `/user/info`,
    data,
  });
}

// 获取验证码
export function getCheckcode(data) {
  return http3.post({
    url: `/checkcode/`,
    data,
  });
}

// 获取用户路由列表接口
export function getRoutesApi() {
  return http4.get({
    url:'/user/routes'
  })
}